// SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>
// SPDX-License-Identifier: MIT

package silk

// nolint: dupl, gochecknoglobals, deadcode, unused, varcheck
var (
	// +----------+-----------------------------+
	// | VAD Flag | PDF                         |
	// +----------+-----------------------------+
	// | Inactive | {26, 230, 0, 0, 0, 0}/256   |
	// |          |                             |
	// | Active   | {0, 0, 24, 74, 148, 10}/256 |
	// +----------+-----------------------------+
	//
	// https://datatracker.ietf.org/doc/html/rfc6716#section-4.2.7.3
	icdfFrameTypeVADInactive = []uint{256, 26, 256}
	icdfFrameTypeVADActive   = []uint{256, 24, 98, 246, 256}

	// +-------------+------------------------------------+
	// | Signal Type | PDF                                |
	// +-------------+------------------------------------+
	// | Inactive    | {32, 112, 68, 29, 12, 1, 1, 1}/256 |
	// |             |                                    |
	// | Unvoiced    | {2, 17, 45, 60, 62, 47, 19, 4}/256 |
	// |             |                                    |
	// | Voiced      | {1, 3, 26, 71, 94, 50, 9, 2}/256   |
	// +-------------+------------------------------------+
	//
	// https://datatracker.ietf.org/doc/html/rfc6716#section-4.2.7.4
	icdfIndependentQuantizationGainMSBInactive = []uint{256, 32, 144, 212, 241, 253, 254, 255, 256}
	icdfIndependentQuantizationGainMSBUnvoiced = []uint{256, 2, 19, 64, 124, 186, 233, 252, 256}
	icdfIndependentQuantizationGainMSBVoiced   = []uint{256, 1, 4, 30, 101, 195, 245, 254, 256}

	// +--------------------------------------+
	// | PDF                                  |
	// +--------------------------------------+
	// | {32, 32, 32, 32, 32, 32, 32, 32}/256 |
	// +--------------------------------------+
	//
	// https://datatracker.ietf.org/doc/html/rfc6716#section-4.2.7.4
	icdfIndependentQuantizationGainLSB = []uint{256, 32, 64, 96, 128, 160, 192, 224, 256}

	// +-------------------------------------------------------------------+
	// | PDF                                                               |
	// +-------------------------------------------------------------------+
	// | {6, 5, 11, 31, 132, 21, 8, 4, 3, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, |
	// | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,       |
	// | 1}/256                                                            |
	// +-------------------------------------------------------------------+
	// PDF for Delta Quantization Gain Coding
	icdfDeltaQuantizationGain = []uint{
		256, 6, 11, 22, 53, 185, 206, 214, 218, 221, 223, 225, 227, 228,
		229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242,
		243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256,
	}

	// +-----------+----------+--------------------------------------------+
	// | Audio     | Signal   | PDF                                        |
	// | Bandwidth | Type     |                                            |
	// +-----------+----------+--------------------------------------------+
	// | NB or MB  | Inactive | {44, 34, 30, 19, 21, 12, 11, 3, 3, 2, 16,  |
	// |           | or       | 2, 2, 1, 5, 2, 1, 3, 3, 1, 1, 2, 2, 2, 3,  |
	// |           | unvoiced | 1, 9, 9, 2, 7, 2, 1}/256                   |
	// |           |          |                                            |
	// | NB or MB  | Voiced   | {1, 10, 1, 8, 3, 8, 8, 14, 13, 14, 1, 14,  |
	// |           |          | 12, 13, 11, 11, 12, 11, 10, 10, 11, 8, 9,  |
	// |           |          | 8, 7, 8, 1, 1, 6, 1, 6, 5}/256             |
	// |           |          |                                            |
	// | WB        | Inactive | {31, 21, 3, 17, 1, 8, 17, 4, 1, 18, 16, 4, |
	// |           | or       | 2, 3, 1, 10, 1, 3, 16, 11, 16, 2, 2, 3, 2, |
	// |           | unvoiced | 11, 1, 4, 9, 8, 7, 3}/256                  |
	// |           |          |                                            |
	// | WB        | Voiced   | {1, 4, 16, 5, 18, 11, 5, 14, 15, 1, 3, 12, |
	// |           |          | 13, 14, 14, 6, 14, 12, 2, 6, 1, 12, 12,    |
	// |           |          | 11, 10, 3, 10, 5, 1, 1, 1, 3}/256          |
	// +-----------+----------+--------------------------------------------+
	// PDFs for Normalized LSF Stage-1 Index Decoding
	icdfNormalizedLSFStageOneIndexNarrowbandOrMediumbandUnvoiced = []uint{
		256, 44, 78, 108, 127, 148, 160, 171, 174, 177, 179, 195, 197, 199, 200,
		205, 207, 208, 211, 214, 215, 216, 218, 220, 222, 225, 226, 235, 244, 246,
		253, 255, 256,
	}
	icdfNormalizedLSFStageOneIndexNarrowbandOrMediumbandVoiced = []uint{
		256, 1, 11, 12, 20, 23, 31, 39, 53, 66, 80, 81, 95, 107, 120, 131, 142, 154,
		165, 175, 185, 196, 204, 213, 221, 228, 236, 237, 238, 244, 245, 251, 256,
	}
	icdfNormalizedLSFStageOneIndexWidebandUnvoiced = []uint{
		256, 31, 52, 55, 72, 73, 81, 98, 102, 103, 121, 137, 141, 143, 146, 147, 157,
		158, 161, 177, 188, 204, 206, 208, 211, 213, 224, 225, 229, 238, 246, 253, 256,
	}
	icdfNormalizedLSFStageOneIndexWidebandVoiced = []uint{
		256, 1, 5, 21, 26, 44, 55, 60, 74, 89, 90, 93, 105, 118, 132, 146, 152, 166, 178,
		180, 186, 187, 199, 211, 222, 232, 235, 245, 250, 251, 252, 253, 256,
	}

	// +-------------------------------+
	// | PDF                           |
	// +-------------------------------+
	// | {156, 60, 24, 9, 4, 2, 1}/256 |
	// +-------------------------------+
	//
	// Normalized LSF Index Extension Decoding
	icdfNormalizedLSFStageTwoIndexExtension = []uint{256, 156, 216, 240, 249, 253, 255, 256}

	// +----------+--------------------------------------+
	// | Codebook | PDF                                  |
	// +----------+--------------------------------------+
	// | a        | {1, 1, 1, 15, 224, 11, 1, 1, 1}/256  |
	// |          |                                      |
	// | b        | {1, 1, 2, 34, 183, 32, 1, 1, 1}/256  |
	// |          |                                      |
	// | c        | {1, 1, 4, 42, 149, 55, 2, 1, 1}/256  |
	// |          |                                      |
	// | d        | {1, 1, 8, 52, 123, 61, 8, 1, 1}/256  |
	// |          |                                      |
	// | e        | {1, 3, 16, 53, 101, 74, 6, 1, 1}/256 |
	// |          |                                      |
	// | f        | {1, 3, 17, 55, 90, 73, 15, 1, 1}/256 |
	// |          |                                      |
	// | g        | {1, 7, 24, 53, 74, 67, 26, 3, 1}/256 |
	// |          |                                      |
	// | h        | {1, 1, 18, 63, 78, 58, 30, 6, 1}/256 |
	// +----------+--------------------------------------+
	//  PDFs for NB/MB Normalized LSF Stage-2 Index Decoding
	//
	// +----------+---------------------------------------+
	// | Codebook | PDF                                   |
	// +----------+---------------------------------------+
	// | i        | {1, 1, 1, 9, 232, 9, 1, 1, 1}/256     |
	// |          |                                       |
	// | j        | {1, 1, 2, 28, 186, 35, 1, 1, 1}/256   |
	// |          |                                       |
	// | k        | {1, 1, 3, 42, 152, 53, 2, 1, 1}/256   |
	// |          |                                       |
	// | l        | {1, 1, 10, 49, 126, 65, 2, 1, 1}/256  |
	// |          |                                       |
	// | m        | {1, 4, 19, 48, 100, 77, 5, 1, 1}/256  |
	// |          |                                       |
	// | n        | {1, 1, 14, 54, 100, 72, 12, 1, 1}/256 |
	// |          |                                       |
	// | o        | {1, 1, 15, 61, 87, 61, 25, 4, 1}/256  |
	// |          |                                       |
	// | p        | {1, 7, 21, 50, 77, 81, 17, 1, 1}/256  |
	// +----------+---------------------------------------+
	// PDFs for WB Normalized LSF Stage-2 Index Decoding
	//
	// NB/MD and WD ICDF are combined because the codebooks
	// do not overlap
	//
	icdfNormalizedLSFStageTwoIndex = [][]uint{
		// Narrowband and Mediumband
		{256, 1, 2, 3, 18, 242, 253, 254, 255, 256},
		{256, 1, 2, 4, 38, 221, 253, 254, 255, 256},
		{256, 1, 2, 6, 48, 197, 252, 254, 255, 256},
		{256, 1, 2, 10, 62, 185, 246, 254, 255, 256},
		{256, 1, 4, 20, 73, 174, 248, 254, 255, 256},
		{256, 1, 4, 21, 76, 166, 239, 254, 255, 256},
		{256, 1, 8, 32, 85, 159, 226, 252, 255, 256},
		{256, 1, 2, 20, 83, 161, 219, 249, 255, 256},

		// Wideband
		{256, 1, 2, 3, 12, 244, 253, 254, 255, 256},
		{256, 1, 2, 4, 32, 218, 253, 254, 255, 256},
		{256, 1, 2, 5, 47, 199, 252, 254, 255, 256},
		{256, 1, 2, 12, 61, 187, 252, 254, 255, 256},
		{256, 1, 5, 24, 72, 172, 249, 254, 255, 256},
		{256, 1, 2, 16, 70, 170, 242, 254, 255, 256},
		{256, 1, 2, 17, 78, 165, 226, 251, 255, 256},
		{256, 1, 8, 29, 79, 156, 237, 254, 255, 256},
	}

	// +---------------------------+
	// | PDF                       |
	// +---------------------------+
	// | {13, 22, 29, 11, 181}/256 |
	// +---------------------------+
	//
	// Table 26: PDF for Normalized LSF Interpolation Index
	icdfNormalizedLSFInterpolationIndex = []uint{
		256, 13, 35, 64, 75, 256,
	}

	// +----------------------+
	// | PDF                  |
	// +----------------------+
	// | {64, 64, 64, 64}/256 |
	// +----------------------+
	//
	// Table 43: PDF for LCG Seed
	icdfLinearCongruentialGeneratorSeed = []uint{
		256, 64, 128, 192, 256,
	}

	// +----------------------+------------------------------------------+
	// | Signal Type          | PDF                                      |
	// +----------------------+------------------------------------------+
	// | Inactive or Unvoiced | {15, 51, 12, 46, 45, 13, 33, 27, 14}/256 |
	// |                      |                                          |
	// | Voiced               | {33, 30, 36, 17, 34, 49, 18, 21, 18}/256 |
	// +----------------------+------------------------------------------+
	//
	// Table 45: PDFs for the Rate Level
	icdfRateLevelUnvoiced = []uint{256, 15, 66, 78, 124, 169, 182, 215, 242, 256}
	icdfRateLevelVoiced   = []uint{256, 33, 63, 99, 116, 150, 199, 217, 238, 256}

	// +----------+--------------------------------------------------------+
	// | Rate     | PDF                                                    |
	// | Level    |                                                        |
	// +----------+--------------------------------------------------------+
	// | 0        | {131, 74, 25, 8, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,   |
	// |          | 1, 1}/256                                              |
	// |          |                                                        |
	// | 1        | {58, 93, 60, 23, 7, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,   |
	// |          | 1, 1}/256                                              |
	// |          |                                                        |
	// | 2        | {43, 51, 46, 33, 24, 16, 11, 8, 6, 3, 3, 3, 2, 1, 1,   |
	// |          | 2, 1, 2}/256                                           |
	// |          |                                                        |
	// | 3        | {17, 52, 71, 57, 31, 12, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
	// |          | 1, 1}/256                                              |
	// |          |                                                        |
	// | 4        | {6, 21, 41, 53, 49, 35, 21, 11, 6, 3, 2, 2, 1, 1, 1,   |
	// |          | 1, 1, 1}/256                                           |
	// |          |                                                        |
	// | 5        | {7, 14, 22, 28, 29, 28, 25, 20, 17, 13, 11, 9, 7, 5,   |
	// |          | 4, 4, 3, 10}/256                                       |
	// |          |                                                        |
	// | 6        | {2, 5, 14, 29, 42, 46, 41, 31, 19, 11, 6, 3, 2, 1, 1,  |
	// |          | 1, 1, 1}/256                                           |
	// |          |                                                        |
	// | 7        | {1, 2, 4, 10, 19, 29, 35, 37, 34, 28, 20, 14, 8, 5, 4, |
	// |          | 2, 2, 2}/256                                           |
	// |          |                                                        |
	// | 8        | {1, 2, 2, 5, 9, 14, 20, 24, 27, 28, 26, 23, 20, 15,    |
	// |          | 11, 8, 6, 15}/256                                      |
	// |          |                                                        |
	// | 9        | {1, 1, 1, 6, 27, 58, 56, 39, 25, 14, 10, 6, 3, 3, 2,   |
	// |          | 1, 1, 2}/256                                           |
	// |          |                                                        |
	// | 10       | {2, 1, 6, 27, 58, 56, 39, 25, 14, 10, 6, 3, 3, 2, 1,   |
	// |          | 1, 2, 0}/256                                           |
	// +----------+--------------------------------------------------------+
	//
	// Table 46: PDFs for the Pulse Count
	icdfPulseCount = [][]uint{
		{256, 131, 205, 230, 238, 241, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256},
		{256, 58, 151, 211, 234, 241, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256},
		{256, 43, 94, 140, 173, 197, 213, 224, 232, 238, 241, 244, 247, 249, 250, 251, 253, 254, 256},
		{256, 17, 69, 140, 197, 228, 240, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256},
		{256, 6, 27, 68, 121, 170, 205, 226, 237, 243, 246, 248, 250, 251, 252, 253, 254, 255, 256},
		{256, 7, 21, 43, 71, 100, 128, 153, 173, 190, 203, 214, 223, 230, 235, 239, 243, 246, 256},
		{256, 2, 7, 21, 50, 92, 138, 179, 210, 229, 240, 246, 249, 251, 252, 253, 254, 255, 256},
		{256, 1, 3, 7, 17, 36, 65, 100, 137, 171, 199, 219, 233, 241, 246, 250, 252, 254, 256},
		{256, 1, 3, 5, 10, 19, 33, 53, 77, 104, 132, 158, 181, 201, 216, 227, 235, 241, 256},
		{256, 1, 2, 3, 9, 36, 94, 150, 189, 214, 228, 238, 244, 247, 250, 252, 253, 254, 256},
		{256, 2, 3, 9, 36, 94, 150, 189, 214, 228, 238, 244, 247, 250, 252, 253, 254, 256, 256},
	}

	// +------------+------------------------------------------------------+
	// | Pulse      | PDF                                                  |
	// | Count      |                                                      |
	// +------------+------------------------------------------------------+
	// | 1          | {126, 130}/256                                       |
	// |            |                                                      |
	// | 2          | {56, 142, 58}/256                                    |
	// |            |                                                      |
	// | 3          | {25, 101, 104, 26}/256                               |
	// |            |                                                      |
	// | 4          | {12, 60, 108, 64, 12}/256                            |
	// |            |                                                      |
	// | 5          | {7, 35, 84, 87, 37, 6}/256                           |
	// |            |                                                      |
	// | 6          | {4, 20, 59, 86, 63, 21, 3}/256                       |
	// |            |                                                      |
	// | 7          | {3, 12, 38, 72, 75, 42, 12, 2}/256                   |
	// |            |                                                      |
	// | 8          | {2, 8, 25, 54, 73, 59, 27, 7, 1}/256                 |
	// |            |                                                      |
	// | 9          | {2, 5, 17, 39, 63, 65, 42, 18, 4, 1}/256             |
	// |            |                                                      |
	// | 10         | {1, 4, 12, 28, 49, 63, 54, 30, 11, 3, 1}/256         |
	// |            |                                                      |
	// | 11         | {1, 4, 8, 20, 37, 55, 57, 41, 22, 8, 2, 1}/256       |
	// |            |                                                      |
	// | 12         | {1, 3, 7, 15, 28, 44, 53, 48, 33, 16, 6, 1, 1}/256   |
	// |            |                                                      |
	// | 13         | {1, 2, 6, 12, 21, 35, 47, 48, 40, 25, 12, 5, 1,      |
	// |            | 1}/256                                               |
	// |            |                                                      |
	// | 14         | {1, 1, 4, 10, 17, 27, 37, 47, 43, 33, 21, 9, 4, 1,   |
	// |            | 1}/256                                               |
	// |            |                                                      |
	// | 15         | {1, 1, 1, 8, 14, 22, 33, 40, 43, 38, 28, 16, 8, 1,   |
	// |            | 1, 1}/256                                            |
	// |            |                                                      |
	// | 16         | {1, 1, 1, 1, 13, 18, 27, 36, 41, 41, 34, 24, 14, 1,  |
	// |            | 1, 1, 1}/256                                         |
	// +------------+------------------------------------------------------+
	//
	// Table 47: PDFs for Pulse Count Split, 16 Sample Partitions
	icdfPulseCountSplit16SamplePartitions = [][]uint{
		{256, 126, 256},
		{256, 56, 198, 256},
		{256, 25, 126, 230, 256},
		{256, 12, 72, 180, 244, 256},
		{256, 7, 42, 126, 213, 250, 256},
		{256, 4, 24, 83, 169, 232, 253, 256},
		{256, 3, 15, 53, 125, 200, 242, 254, 256},
		{256, 2, 10, 35, 89, 162, 221, 248, 255, 256},
		{256, 2, 7, 24, 63, 126, 191, 233, 251, 255, 256},
		{256, 1, 5, 17, 45, 94, 157, 211, 241, 252, 255, 256},
		{256, 1, 5, 13, 33, 70, 125, 182, 223, 245, 253, 255, 256},
		{256, 1, 4, 11, 26, 54, 98, 151, 199, 232, 248, 254, 255, 256},
		{256, 1, 3, 9, 21, 42, 77, 124, 172, 212, 237, 249, 254, 255, 256},
		{256, 1, 2, 6, 16, 33, 60, 97, 144, 187, 220, 241, 250, 254, 255, 256},
		{256, 1, 2, 3, 11, 25, 47, 80, 120, 163, 201, 229, 245, 253, 254, 255, 256},
		{256, 1, 2, 3, 4, 17, 35, 62, 98, 139, 180, 214, 238, 252, 253, 254, 255, 256},
	}

	// +------------+------------------------------------------------------+
	// | Pulse      | PDF                                                  |
	// | Count      |                                                      |
	// +------------+------------------------------------------------------+
	// | 1          | {127, 129}/256                                       |
	// |            |                                                      |
	// | 2          | {53, 149, 54}/256                                    |
	// |            |                                                      |
	// | 3          | {22, 105, 106, 23}/256                               |
	// |            |                                                      |
	// | 4          | {11, 61, 111, 63, 10}/256                            |
	// |            |                                                      |
	// | 5          | {6, 35, 86, 88, 36, 5}/256                           |
	// |            |                                                      |
	// | 6          | {4, 20, 59, 87, 62, 21, 3}/256                       |
	// |            |                                                      |
	// | 7          | {3, 13, 40, 71, 73, 41, 13, 2}/256                   |
	// |            |                                                      |
	// | 8          | {3, 9, 27, 53, 70, 56, 28, 9, 1}/256                 |
	// |            |                                                      |
	// | 9          | {3, 8, 19, 37, 57, 61, 44, 20, 6, 1}/256             |
	// |            |                                                      |
	// | 10         | {3, 7, 15, 28, 44, 54, 49, 33, 17, 5, 1}/256         |
	// |            |                                                      |
	// | 11         | {1, 7, 13, 22, 34, 46, 48, 38, 28, 14, 4, 1}/256     |
	// |            |                                                      |
	// | 12         | {1, 1, 11, 22, 27, 35, 42, 47, 33, 25, 10, 1, 1}/256 |
	// |            |                                                      |
	// | 13         | {1, 1, 6, 14, 26, 37, 43, 43, 37, 26, 14, 6, 1,      |
	// |            | 1}/256                                               |
	// |            |                                                      |
	// | 14         | {1, 1, 4, 10, 20, 31, 40, 42, 40, 31, 20, 10, 4, 1,  |
	// |            | 1}/256                                               |
	// |            |                                                      |
	// | 15         | {1, 1, 3, 8, 16, 26, 35, 38, 38, 35, 26, 16, 8, 3,   |
	// |            | 1, 1}/256                                            |
	// |            |                                                      |
	// | 16         | {1, 1, 2, 6, 12, 21, 30, 36, 38, 36, 30, 21, 12, 6,  |
	// |            | 2, 1, 1}/256                                         |
	// +------------+------------------------------------------------------+
	// Table 48: PDFs for Pulse Count Split, 8 Sample Partitions
	icdfPulseCountSplit8SamplePartitions = [][]uint{
		{256, 127, 256},
		{256, 53, 202, 256},
		{256, 22, 127, 233, 256},
		{256, 11, 72, 183, 246, 256},
		{256, 6, 41, 127, 215, 251, 256},
		{256, 4, 24, 83, 170, 232, 253, 256},
		{256, 3, 16, 56, 127, 200, 241, 254, 256},
		{256, 3, 12, 39, 92, 162, 218, 246, 255, 256},
		{256, 3, 11, 30, 67, 124, 185, 229, 249, 255, 256},
		{256, 3, 10, 25, 53, 97, 151, 200, 233, 250, 255, 256},
		{256, 1, 8, 21, 43, 77, 123, 171, 209, 237, 251, 255, 256},
		{256, 1, 2, 13, 35, 62, 97, 139, 186, 219, 244, 254, 255, 256},
		{256, 1, 2, 8, 22, 48, 85, 128, 171, 208, 234, 248, 254, 255, 256},
		{256, 1, 2, 6, 16, 36, 67, 107, 149, 189, 220, 240, 250, 254, 255, 256},
		{256, 1, 2, 5, 13, 29, 55, 90, 128, 166, 201, 227, 243, 251, 254, 255, 256},
		{256, 1, 2, 4, 10, 22, 43, 73, 109, 147, 183, 213, 234, 246, 252, 254, 255, 256},
	}

	// +------------+------------------------------------------------------+
	// | Pulse      | PDF                                                  |
	// | Count      |                                                      |
	// +------------+------------------------------------------------------+
	// | 1          | {127, 129}/256                                       |
	// |            |                                                      |
	// | 2          | {49, 157, 50}/256                                    |
	// |            |                                                      |
	// | 3          | {20, 107, 109, 20}/256                               |
	// |            |                                                      |
	// | 4          | {11, 60, 113, 62, 10}/256                            |
	// |            |                                                      |
	// | 5          | {7, 36, 84, 87, 36, 6}/256                           |
	// |            |                                                      |
	// | 6          | {6, 24, 57, 82, 60, 23, 4}/256                       |
	// |            |                                                      |
	// | 7          | {5, 18, 39, 64, 68, 42, 16, 4}/256                   |
	// |            |                                                      |
	// | 8          | {6, 14, 29, 47, 61, 52, 30, 14, 3}/256               |
	// |            |                                                      |
	// | 9          | {1, 15, 23, 35, 51, 50, 40, 30, 10, 1}/256           |
	// |            |                                                      |
	// | 10         | {1, 1, 21, 32, 42, 52, 46, 41, 18, 1, 1}/256         |
	// |            |                                                      |
	// | 11         | {1, 6, 16, 27, 36, 42, 42, 36, 27, 16, 6, 1}/256     |
	// |            |                                                      |
	// | 12         | {1, 5, 12, 21, 31, 38, 40, 38, 31, 21, 12, 5, 1}/256 |
	// |            |                                                      |
	// | 13         | {1, 3, 9, 17, 26, 34, 38, 38, 34, 26, 17, 9, 3,      |
	// |            | 1}/256                                               |
	// |            |                                                      |
	// | 14         | {1, 3, 7, 14, 22, 29, 34, 36, 34, 29, 22, 14, 7, 3,  |
	// |            | 1}/256                                               |
	// |            |                                                      |
	// | 15         | {1, 2, 5, 11, 18, 25, 31, 35, 35, 31, 25, 18, 11, 5, |
	// |            | 2, 1}/256                                            |
	// |            |                                                      |
	// | 16         | {1, 1, 4, 9, 15, 21, 28, 32, 34, 32, 28, 21, 15, 9,  |
	// |            | 4, 1, 1}/256                                         |
	// +------------+------------------------------------------------------+
	// Table 49: PDFs for Pulse Count Split, 4 Sample Partitions
	icdfPulseCountSplit4SamplePartitions = [][]uint{
		{256, 127, 256},
		{256, 49, 206, 256},
		{256, 20, 127, 236, 256},
		{256, 11, 71, 184, 246, 256},
		{256, 7, 43, 127, 214, 250, 256},
		{256, 6, 30, 87, 169, 229, 252, 256},
		{256, 5, 23, 62, 126, 194, 236, 252, 256},
		{256, 6, 20, 49, 96, 157, 209, 239, 253, 256},
		{256, 1, 16, 39, 74, 125, 175, 215, 245, 255, 256},
		{256, 1, 2, 23, 55, 97, 149, 195, 236, 254, 255, 256},
		{256, 1, 7, 23, 50, 86, 128, 170, 206, 233, 249, 255, 256},
		{256, 1, 6, 18, 39, 70, 108, 148, 186, 217, 238, 250, 255, 256},
		{256, 1, 4, 13, 30, 56, 90, 128, 166, 200, 226, 243, 252, 255, 256},
		{256, 1, 4, 11, 25, 47, 76, 110, 146, 180, 209, 231, 245, 252, 255, 256},
		{256, 1, 3, 8, 19, 37, 62, 93, 128, 163, 194, 219, 237, 248, 253, 255, 256},
		{256, 1, 2, 6, 15, 30, 51, 79, 111, 145, 177, 205, 226, 241, 250, 254, 255, 256},
	}

	// +------------+------------------------------------------------------+
	// | Pulse      | PDF                                                  |
	// | Count      |                                                      |
	// +------------+------------------------------------------------------+
	// | 1          | {128, 128}/256                                       |
	// |            |                                                      |
	// | 2          | {42, 172, 42}/256                                    |
	// |            |                                                      |
	// | 3          | {21, 107, 107, 21}/256                               |
	// |            |                                                      |
	// | 4          | {12, 60, 112, 61, 11}/256                            |
	// |            |                                                      |
	// | 5          | {8, 34, 86, 86, 35, 7}/256                           |
	// |            |                                                      |
	// | 6          | {8, 23, 55, 90, 55, 20, 5}/256                       |
	// |            |                                                      |
	// | 7          | {5, 15, 38, 72, 72, 36, 15, 3}/256                   |
	// |            |                                                      |
	// | 8          | {6, 12, 27, 52, 77, 47, 20, 10, 5}/256               |
	// |            |                                                      |
	// | 9          | {6, 19, 28, 35, 40, 40, 35, 28, 19, 6}/256           |
	// |            |                                                      |
	// | 10         | {4, 14, 22, 31, 37, 40, 37, 31, 22, 14, 4}/256       |
	// |            |                                                      |
	// | 11         | {3, 10, 18, 26, 33, 38, 38, 33, 26, 18, 10, 3}/256   |
	// |            |                                                      |
	// | 12         | {2, 8, 13, 21, 29, 36, 38, 36, 29, 21, 13, 8, 2}/256 |
	// |            |                                                      |
	// | 13         | {1, 5, 10, 17, 25, 32, 38, 38, 32, 25, 17, 10, 5,    |
	// |            | 1}/256                                               |
	// |            |                                                      |
	// | 14         | {1, 4, 7, 13, 21, 29, 35, 36, 35, 29, 21, 13, 7, 4,  |
	// |            | 1}/256                                               |
	// |            |                                                      |
	// | 15         | {1, 2, 5, 10, 17, 25, 32, 36, 36, 32, 25, 17, 10, 5, |
	// |            | 2, 1}/256                                            |
	// |            |                                                      |
	// | 16         | {1, 2, 4, 7, 13, 21, 28, 34, 36, 34, 28, 21, 13, 7,  |
	// |            | 4, 2, 1}/256                                         |
	// +------------+------------------------------------------------------+
	// Table 50: PDFs for Pulse Count Split, 2 Sample Partitions
	icdfPulseCountSplit2SamplePartitions = [][]uint{
		{256, 128, 256},
		{256, 42, 214, 256},
		{256, 21, 128, 235, 256},
		{256, 12, 72, 184, 245, 256},
		{256, 8, 42, 128, 214, 249, 256},
		{256, 8, 31, 86, 176, 231, 251, 256},
		{256, 5, 20, 58, 130, 202, 238, 253, 256},
		{256, 6, 18, 45, 97, 174, 221, 241, 251, 256},
		{256, 6, 25, 53, 88, 128, 168, 203, 231, 250, 256},
		{256, 4, 18, 40, 71, 108, 148, 185, 216, 238, 252, 256},
		{256, 3, 13, 31, 57, 90, 128, 166, 199, 225, 243, 253, 256},
		{256, 2, 10, 23, 44, 73, 109, 147, 183, 212, 233, 246, 254, 256},
		{256, 1, 6, 16, 33, 58, 90, 128, 166, 198, 223, 240, 250, 255, 256},
		{256, 1, 5, 12, 25, 46, 75, 110, 146, 181, 210, 231, 244, 251, 255, 256},
		{256, 1, 3, 8, 18, 35, 60, 92, 128, 164, 196, 221, 238, 248, 253, 255, 256},
		{256, 1, 3, 7, 14, 27, 48, 76, 110, 146, 180, 208, 229, 242, 249, 253, 255, 256},
	}

	// +----------------+
	// | PDF            |
	// +----------------+
	// | {136, 120}/256 |
	// +----------------+
	//
	// Table 51: PDF for Excitation LSBs
	icdfExcitationLSB = []uint{256, 136, 256}

	// +-------------+-----------------------+-------------+---------------+
	// | Signal Type | Quantization Offset   | Pulse Count | PDF           |
	// |             | Type                  |             |               |
	// +-------------+-----------------------+-------------+---------------+
	// | Inactive    | Low                   | 0           | {2, 254}/256  |
	// |             |                       |             |               |
	// | Inactive    | Low                   | 1           | {207, 49}/256 |
	// |             |                       |             |               |
	// | Inactive    | Low                   | 2           | {189, 67}/256 |
	// |             |                       |             |               |
	// | Inactive    | Low                   | 3           | {179, 77}/256 |
	// |             |                       |             |               |
	// | Inactive    | Low                   | 4           | {174, 82}/256 |
	// |             |                       |             |               |
	// | Inactive    | Low                   | 5           | {163, 93}/256 |
	// |             |                       |             |               |
	// | Inactive    | Low                   | 6 or more   | {157, 99}/256 |
	// |             |                       |             |               |
	// | Inactive    | High                  | 0           | {58, 198}/256 |
	// |             |                       |             |               |
	// | Inactive    | High                  | 1           | {245, 11}/256 |
	// |             |                       |             |               |
	// | Inactive    | High                  | 2           | {238, 18}/256 |
	// |             |                       |             |               |
	// | Inactive    | High                  | 3           | {232, 24}/256 |
	// |             |                       |             |               |
	// | Inactive    | High                  | 4           | {225, 31}/256 |
	// |             |                       |             |               |
	// | Inactive    | High                  | 5           | {220, 36}/256 |
	// |             |                       |             |               |
	// | Inactive    | High                  | 6 or more   | {211, 45}/256 |
	// |             |                       |             |               |
	// | Unvoiced    | Low                   | 0           | {1, 255}/256  |
	// |             |                       |             |               |
	// | Unvoiced    | Low                   | 1           | {210, 46}/256 |
	// |             |                       |             |               |
	// | Unvoiced    | Low                   | 2           | {190, 66}/256 |
	// |             |                       |             |               |
	// | Unvoiced    | Low                   | 3           | {178, 78}/256 |
	// |             |                       |             |               |
	// | Unvoiced    | Low                   | 4           | {169, 87}/256 |
	// |             |                       |             |               |
	// | Unvoiced    | Low                   | 5           | {162, 94}/256 |
	// |             |                       |             |               |
	// | Unvoiced    | Low                   | 6 or more   | {152,104}/256 |
	// |             |                       |             |               |
	// | Unvoiced    | High                  | 0           | {48, 208}/256 |
	// |             |                       |             |               |
	// | Unvoiced    | High                  | 1           | {242, 14}/256 |
	// |             |                       |             |               |
	// | Unvoiced    | High                  | 2           | {235, 21}/256 |
	// |             |                       |             |               |
	// | Unvoiced    | High                  | 3           | {224, 32}/256 |
	// |             |                       |             |               |
	// | Unvoiced    | High                  | 4           | {214, 42}/256 |
	// |             |                       |             |               |
	// | Unvoiced    | High                  | 5           | {205, 51}/256 |
	// |             |                       |             |               |
	// | Unvoiced    | High                  | 6 or more   | {190, 66}/256 |
	// |             |                       |             |               |
	// | Voiced      | Low                   | 0           | {1, 255}/256  |
	// |             |                       |             |               |
	// | Voiced      | Low                   | 1           | {162, 94}/256 |
	// |             |                       |             |               |
	// | Voiced      | Low                   | 2           | {152,         |
	// |             |                       |             | 104}/256      |
	// |             |                       |             |               |
	// | Voiced      | Low                   | 3           | {147,         |
	// |             |                       |             | 109}/256      |
	// |             |                       |             |               |
	// | Voiced      | Low                   | 4           | {144, 112}/256|
	// |             |                       |             |               |
	// | Voiced      | Low                   | 5           | {141, 115}/256|
	// |             |                       |             |               |
	// | Voiced      | Low                   | 6 or more   | {138, 118}/256|
	// |             |                       |             |               |
	// | Voiced      | High                  | 0           | {8, 248}/256  |
	// |             |                       |             |               |
	// | Voiced      | High                  | 1           | {203, 53}/256 |
	// |             |                       |             |               |
	// | Voiced      | High                  | 2           | {187, 69}/256 |
	// |             |                       |             |               |
	// | Voiced      | High                  | 3           | {176, 80}/256 |
	// |             |                       |             |               |
	// | Voiced      | High                  | 4           | {168, 88}/256 |
	// |             |                       |             |               |
	// | Voiced      | High                  | 5           | {161, 95}/256 |
	// |             |                       |             |               |
	// | Voiced      | High                  | 6 or more   | {154,102}/256 |
	// +-------------+-----------------------+-------------+---------------+
	//
	// Table 52: PDFs for Excitation Signs
	icdfExcitationSignInactiveSignalLowQuantization0Pulse      = []uint{256, 2, 256}
	icdfExcitationSignInactiveSignalLowQuantization1Pulse      = []uint{256, 207, 256}
	icdfExcitationSignInactiveSignalLowQuantization2Pulse      = []uint{256, 189, 256}
	icdfExcitationSignInactiveSignalLowQuantization3Pulse      = []uint{256, 179, 256}
	icdfExcitationSignInactiveSignalLowQuantization4Pulse      = []uint{256, 174, 256}
	icdfExcitationSignInactiveSignalLowQuantization5Pulse      = []uint{256, 163, 256}
	icdfExcitationSignInactiveSignalLowQuantization6PlusPulse  = []uint{256, 157, 256}
	icdfExcitationSignInactiveSignalHighQuantization0Pulse     = []uint{256, 58, 256}
	icdfExcitationSignInactiveSignalHighQuantization1Pulse     = []uint{256, 245, 256}
	icdfExcitationSignInactiveSignalHighQuantization2Pulse     = []uint{256, 238, 256}
	icdfExcitationSignInactiveSignalHighQuantization3Pulse     = []uint{256, 232, 256}
	icdfExcitationSignInactiveSignalHighQuantization4Pulse     = []uint{256, 225, 256}
	icdfExcitationSignInactiveSignalHighQuantization5Pulse     = []uint{256, 220, 256}
	icdfExcitationSignInactiveSignalHighQuantization6PlusPulse = []uint{256, 211, 256}
	icdfExcitationSignUnvoicedSignalLowQuantization0Pulse      = []uint{256, 1, 256}
	icdfExcitationSignUnvoicedSignalLowQuantization1Pulse      = []uint{256, 210, 256}
	icdfExcitationSignUnvoicedSignalLowQuantization2Pulse      = []uint{256, 190, 256}
	icdfExcitationSignUnvoicedSignalLowQuantization3Pulse      = []uint{256, 178, 256}
	icdfExcitationSignUnvoicedSignalLowQuantization4Pulse      = []uint{256, 169, 256}
	icdfExcitationSignUnvoicedSignalLowQuantization5Pulse      = []uint{256, 162, 256}
	icdfExcitationSignUnvoicedSignalLowQuantization6PlusPulse  = []uint{256, 152, 256}
	icdfExcitationSignUnvoicedSignalHighQuantization0Pulse     = []uint{256, 48, 256}
	icdfExcitationSignUnvoicedSignalHighQuantization1Pulse     = []uint{256, 242, 256}
	icdfExcitationSignUnvoicedSignalHighQuantization2Pulse     = []uint{256, 235, 256}
	icdfExcitationSignUnvoicedSignalHighQuantization3Pulse     = []uint{256, 224, 256}
	icdfExcitationSignUnvoicedSignalHighQuantization4Pulse     = []uint{256, 214, 256}
	icdfExcitationSignUnvoicedSignalHighQuantization5Pulse     = []uint{256, 205, 256}
	icdfExcitationSignUnvoicedSignalHighQuantization6PlusPulse = []uint{256, 190, 256}
	icdfExcitationSignVoicedSignalLowQuantization0Pulse        = []uint{256, 1, 256}
	icdfExcitationSignVoicedSignalLowQuantization1Pulse        = []uint{256, 162, 256}
	icdfExcitationSignVoicedSignalLowQuantization2Pulse        = []uint{256, 152, 256}
	icdfExcitationSignVoicedSignalLowQuantization3Pulse        = []uint{256, 147, 256}
	icdfExcitationSignVoicedSignalLowQuantization4Pulse        = []uint{256, 144, 256}
	icdfExcitationSignVoicedSignalLowQuantization5Pulse        = []uint{256, 141, 256}
	icdfExcitationSignVoicedSignalLowQuantization6PlusPulse    = []uint{256, 138, 256}
	icdfExcitationSignVoicedSignalHighQuantization0Pulse       = []uint{256, 8, 256}
	icdfExcitationSignVoicedSignalHighQuantization1Pulse       = []uint{256, 203, 256}
	icdfExcitationSignVoicedSignalHighQuantization2Pulse       = []uint{256, 187, 256}
	icdfExcitationSignVoicedSignalHighQuantization3Pulse       = []uint{256, 176, 256}
	icdfExcitationSignVoicedSignalHighQuantization4Pulse       = []uint{256, 168, 256}
	icdfExcitationSignVoicedSignalHighQuantization5Pulse       = []uint{256, 161, 256}
	icdfExcitationSignVoicedSignalHighQuantization6PlusPulse   = []uint{256, 154, 256}

	//  +-------------------------------------------------------------------+
	//  | PDF                                                               |
	//  +-------------------------------------------------------------------+
	//  | {3, 3, 6, 11, 21, 30, 32, 19, 11, 10, 12, 13, 13, 12, 11, 9, 8,   |
	//  | 7, 6, 4, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1}/256                  |
	//  +-------------------------------------------------------------------+
	//
	//  Table 29: PDF for High Part of Primary Pitch Lag
	//
	// https://www.rfc-editor.org/rfc/rfc6716.html#section-4.2.7.6.1
	icdfPrimaryPitchLagHighPart = []uint{
		256, 3, 6, 12, 23, 44, 74, 106, 125, 136,
		146, 158, 171, 184, 196, 207, 216, 224, 231, 237,
		241, 243, 245, 247, 248, 249, 250, 251, 252, 253,
		254, 255, 256,
	}

	// +------------+------------------------+-------+----------+----------+
	// | Audio      | PDF                    | Scale | Minimum  | Maximum  |
	// | Bandwidth  |                        |       | Lag      | Lag      |
	// +------------+------------------------+-------+----------+----------+
	// | NB         | {64, 64, 64, 64}/256   | 4     | 16       | 144      |
	// |            |                        |       |          |          |
	// | MB         | {43, 42, 43, 43, 42,   | 6     | 24       | 216      |
	// |            | 43}/256                |       |          |          |
	// |            |                        |       |          |          |
	// | WB         | {32, 32, 32, 32, 32,   | 8     | 32       | 288      |
	// |            | 32, 32, 32}/256        |       |          |          |
	// +------------+------------------------+-------+----------+----------+
	//
	//            Table 30: PDF for Low Part of Primary Pitch Lag
	//
	// https://www.rfc-editor.org/rfc/rfc6716.html#section-4.2.7.6.1
	icdfPrimaryPitchLagLowPartNarrowband = []uint{256, 64, 128, 192, 256}
	icdfPrimaryPitchLagLowPartMediumband = []uint{256, 43, 85, 128, 171, 213, 256}
	icdfPrimaryPitchLagLowPartWideband   = []uint{256, 32, 64, 96, 128, 160, 192, 224, 256}

	// +-----------+--------+----------+-----------------------------------+
	// | Audio     | SILK   | Codebook | PDF                               |
	// | Bandwidth | Frame  |     Size |                                   |
	// |           | Size   |          |                                   |
	// +-----------+--------+----------+-----------------------------------+
	// | NB        | 10 ms  |        3 | {143, 50, 63}/256                 |
	// |           |        |          |                                   |
	// | NB        | 20 ms  |       11 | {68, 12, 21, 17, 19, 22, 30, 24,  |
	// |           |        |          | 17, 16, 10}/256                   |
	// |           |        |          |                                   |
	// | MB or WB  | 10 ms  |       12 | {91, 46, 39, 19, 14, 12, 8, 7, 6, |
	// |           |        |          | 5, 5, 4}/256                      |
	// |           |        |          |                                   |
	// | MB or WB  | 20 ms  |       34 | {33, 22, 18, 16, 15, 14, 14, 13,  |
	// |           |        |          | 13, 10, 9, 9, 8, 6, 6, 6, 5, 4,   |
	// |           |        |          | 4, 4, 3, 3, 3, 2, 2, 2, 2, 2, 2,  |
	// |           |        |          | 2, 1, 1, 1, 1}/256                |
	// +-----------+--------+----------+-----------------------------------+
	//
	// Table 32: PDFs for Subframe Pitch Contour
	//
	// https://www.rfc-editor.org/rfc/rfc6716.html#section-4.2.7.6.1
	icdfSubframePitchContourNarrowband10Ms = []uint{
		256, 143, 193, 256,
	}
	icdfSubframePitchContourNarrowband20Ms = []uint{
		256, 68, 80, 101, 118, 137, 159, 189, 213, 230, 246, 256,
	}
	icdfSubframePitchContourMediumbandOrWideband10Ms = []uint{
		256, 91, 137, 176, 195, 209, 221, 229, 236, 242, 247, 252, 256,
	}
	icdfSubframePitchContourMediumbandOrWideband20Ms = []uint{
		256, 33, 55, 73, 89, 104, 118, 132, 145, 158, 168, 177,
		186, 194, 200, 206, 212, 217, 221, 225, 229, 232, 235, 238,
		240, 242, 244, 246, 248, 250, 252, 253, 254, 255, 256,
	}

	// +------------------+
	// | PDF              |
	// +------------------+
	// | {77, 80, 99}/256 |
	// +------------------+
	//
	// Table 37: Periodicity Index PDF
	//
	// https://www.rfc-editor.org/rfc/rfc6716.html#section-4.2.7.6.2
	icdfPeriodicityIndex = []uint{
		256, 77, 157, 256,
	}

	// +-------------+----------+------------------------------------------+
	// | Periodicity | Codebook | PDF                                      |
	// | Index       |     Size |                                          |
	// +-------------+----------+------------------------------------------+
	// | 0           |        8 | {185, 15, 13, 13, 9, 9, 6, 6}/256        |
	// |             |          |                                          |
	// | 1           |       16 | {57, 34, 21, 20, 15, 13, 12, 13, 10, 10, |
	// |             |          | 9, 10, 9, 8, 7, 8}/256                   |
	// |             |          |                                          |
	// | 2           |       32 | {15, 16, 14, 12, 12, 12, 11, 11, 11, 10, |
	// |             |          | 9, 9, 9, 9, 8, 8, 8, 8, 7, 7, 6, 6, 5,   |
	// |             |          | 4, 5, 4, 4, 4, 3, 4, 3, 2}/256           |
	// +-------------+----------+------------------------------------------+
	//
	// Table 38: LTP Filter PDFs
	//
	// https://www.rfc-editor.org/rfc/rfc6716.html#section-4.2.7.6.2
	icdfLTPFilterIndex0 = []uint{
		256, 185, 200, 213, 226, 235, 244, 250, 256,
	}
	icdfLTPFilterIndex1 = []uint{
		256, 57, 91, 112, 132, 147, 160, 172, 185,
		195, 205, 214, 224, 233, 241, 248, 256,
	}
	icdfLTPFilterIndex2 = []uint{
		256, 15, 31, 45, 57, 69, 81, 92, 103, 114, 124,
		133, 142, 151, 160, 168, 176, 184, 192, 199, 206, 212,
		218, 223, 227, 232, 236, 240, 244, 247, 251, 254, 256,
	}

	// +-------------------+
	// | PDF               |
	// +-------------------+
	// | {128, 64, 64}/256 |
	// +-------------------+
	//
	// Table 42: PDF for LTP Scaling Parameter
	//
	// https://www.rfc-editor.org/rfc/rfc6716.html#section-4.2.7.6.3
	icdfLTPScalingParameter = []uint{256, 128, 192, 256}
)
